<?php
/**
 * view สำหรับ Query Customer by supplier_id
 */
class VSCustomer extends AppModel {
    var $name = 'VSCustomer';

    var $hasMany = array('UserCoH');

    var $useTable = 'v_suppliers_customers';

    function findListByCustomerOnHand($user_id, $supplier_id) {
        $customers = $this->UserCoH->listCustomerOnHand($user_id);
        return $this->find('list', array('conditions' => array('supplier_id' => $supplier_id, 'id' => $customers)));
    }
}
?>
